<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width-device-height,user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover"/>
    <meta name="referrer" content="no-referrer"/>

    <title>获取UserAgent</title>
</head>
<body>
<div style="margin-bottom: 50px; text-align: center;">
    <span>我是一个html页面</span>
</div>
<div style="display: flex; flex-direction: column; align-items: center;">
    <div>
        <span id="result"></span>
    </div>

</div>
</body>
<script>
    window.onload = function() {
        const resultText = document.getElementById("result");
        resultText.innerHTML = navigator.userAgent;
    }
</script>
</html>